package com.znjc.device.service;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.znjc.device.domain.DeviceType;
import com.znjc.device.domain.IotSerial;

/**
 * 串口Service接口
 *
 * @author zengpc
 * @date 2023-12-04
 */
public interface IIotSerialService extends IService<IotSerial> {
    /**
     * 解析数据
     * @param data
     */
    public void analyzeData(JSONObject data) throws Exception;

    IotSerial getSerialByTypeId(Long typeId);

    /**
     * 关闭串口
     * @param serial
     */
    void closePort(IotSerial serial);

    /**
     * 开启关闭采集
     * @param serial
     */
    void editGather(IotSerial serial, String status);

    /**
     * 对所有串口下发命令
     * @param deptId
     * @param command
     */
    void sendCommand(Long deptId,String command,String commandName);

    /**
     * 关闭采集
     */
    void closeGather(Long deptId);


}
